<?php



/**
 * This class defines the structure of the 'w_lp_vv_WizJedn' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    propel.generator.lp.map
 */
class LpUnitsTableMap extends TableMap
{

    /**
     * The (dot-path) name of this class
     */
    const CLASS_NAME = 'lp.map.LpUnitsTableMap';

    /**
     * Initialize the table attributes, columns and validators
     * Relations are not initialized by this method since they are lazy loaded
     *
     * @return void
     * @throws PropelException
     */
    public function initialize()
    {
        // attributes
        $this->setName('w_lp_vv_WizJedn');
        $this->setPhpName('Units');
        $this->setClassname('LpUnits');
        $this->setPackage('lp');
        $this->setUseIdGenerator(false);
        // columns
        $this->addPrimaryKey('ID_JEDN', 'Id', 'VARCHAR', true, 30, null);
        $this->addForeignKey('ID_NAD_JEDN', 'ParentId', 'VARCHAR', 'w_lp_vv_WizJedn', 'ID_JEDN', false, 30, null);
        $this->addColumn('NR_OS_KIER', 'SupervisorLogoId', 'VARCHAR', false, 15, null);
        $this->addColumn('NAZWA_JEDN', 'NamePl', 'VARCHAR', true, 100, null);
        $this->addColumn('NAZWA_JEDN_ANG', 'NameEn', 'VARCHAR', true, 100, null);
        // validators
    } // initialize()

    /**
     * Build the RelationMap objects for this table relationships
     */
    public function buildRelations()
    {
        $this->addRelation('UnitsRelatedByParentId', 'LpUnits', RelationMap::MANY_TO_ONE, array('ID_NAD_JEDN' => 'ID_JEDN', ), null, null);
        $this->addRelation('UnitsRelatedById', 'LpUnits', RelationMap::ONE_TO_MANY, array('ID_JEDN' => 'ID_NAD_JEDN', ), null, null, 'UnitssRelatedById');
        $this->addRelation('EmployeesPositions', 'LpEmployeesPositions', RelationMap::ONE_TO_MANY, array('ID_JEDN' => 'ID_JEDN', ), null, null, 'EmployeesPositionss');
    } // buildRelations()

} // LpUnitsTableMap
